<template lang="html">
  <div class="accesslog">
    <div class='searchView'>
      <el-table
        :data="tableData"
        style="width: 100%">
        <el-table-column
          type="index"
          width="50">
        </el-table-column>
        <el-table-column
          prop="date"
          label="时间">
        </el-table-column>
        <el-table-column
          prop="userName"
          label="用户名">
        </el-table-column>
        <el-table-column
          prop="ip"
          label="IP">
        </el-table-column>
        <el-table-column
          prop="url"
          label="URL">
        </el-table-column>
      </el-table>

      <div class="pageBlock">
        <el-pagination
          @size-change="handleSizeChange"
          @current-change="handleCurrentChange"
          :current-page.sync="currentPage"
          :page-size="pageSize"
          layout="prev, pager, next, jumper, sizes"
          :total="totalData">
        </el-pagination>
      </div>
    </div>
  </div>
</template>
<script>
import data from './data/accessLogData';
export default {
  data () {
    return {
      tableData:data,
      pickerValue:[],
      searchForm:{
      },
      loading:false,
      pageSize:50,
      currentPage:1,
      totalData:data.length
    }
  },
  methods:{
    handleSizeChange(val) {
      console.log(`每页 ${val} 条`);
    },
    handleCurrentChange(val) {
      console.log(`当前页: ${val}`);
      this.currentPage = val;
      // this.getList();
    },
    unactiveIt(row){
      this.$confirm('是否确认取消激活状态',{center:true})
      .then(res =>{

        this.loading = true;
        tools.ajax({
          url:`/user_service/v1/users/${this.roleInfo.userId}/roles/${row.id}`,
          data:{
            disabled:1
          },
          type:'PUT'
        })
        .then(res => {
          this.loading = false;
          if(res.code == 200){
            tools.toastOk('取消激活成功');
            this.dialogVisible = false;
            this.getList(1);
          }
        })
        .catch(e => {
        })

      }).catch( e=> {})
    },
    tourl(url,query){
      tools.router.push({path:url,query:query || {}})
    }
  },
  mounted(){
    var _this = this;
  },
  components:{

  }
}
</script>

<style scoped lang='scss'>
@import '../../assets/scss/tool.scss';
.accesslog{

}
</style>
